class KerjoMailer < ActionMailer::Base
  def invite(from,to,url)
  	subject="An invitation"
  	@body["friend"] = to
  	@body["user"] = from
  	@body["url"]=url
  	setup_email(from,to,subject)
  end

  def notify(from,to,myname,hisname,url)
  	subject="I'v added you as my friend"
  	@body["friend"] = hisname+'('+to+')'
  	@body["user"] = myname+'('+from+')'
  	@body["url"]=url
  	setup_email(from,to,subject)
  end

  def setup_email(from,to,subject)
    @recipients = to
    @from       = from
    @subject    = subject
    @sent_on    = Time.now
    @content_type = "text/html"
    #@headers['Content-Type'] = "text/plain; charset=utf-8; format=flowed"
    #@headers['Content-Type'] = "text/html; charset=utf-8"
  end  
end
